<!--Gordana Pejic 191/01-->
<!-- Darija Dasic 97/08-->
<?php


require_once dirname(__FILE__).  '/db.php';

$con=dbConnect("sib");

$hid=$_GET["hid"];
$result=mysql_query("SELECT * FROM hostel WHERE IDHostel='$hid'", $con);
$row=mysql_fetch_array($result);
$result_photo=mysql_query("SELECT * FROM photo WHERE IDHostel='$hid' AND IndexPhoto='1'", $con);
$row_photo=mysql_fetch_array($result_photo);
$result_photo_notindex = mysql_query("SELECT * FROM photo WHERE IDHostel='$hid' AND IndexPhoto='0'", $con);

$name=$row["Name"];
$address=$row["Address"];
$latitute=$row["Latitude"];
$longitude=$row["Longitude"];
$pricemin=$row["PriceMin"];
$pricemax=$row["PriceMax"];
$rooms=$row["NumOfRooms"];
$beds=$row["NumOfBeds"];
$toilets=$row["NumOfToilets"];
$included=$row["IncludedInPrice"];
$reception=$row["Reception"];
$web=$row["WebAccess"];
$fooddrink=$row["FoodDrink"];
$inroom=$row["InRoom"];
$todo=$row["ThingsToDo"];
$general=$row["General"];
$desc=$row["Description"];


echo '<div id="feedback">
                <a href="feedback.php?hid='.$hid.'">&nbsp;</a>
      </div>

     <div class="onehostel">
                
		<div id="hostelinfo">
                <h2>'.$name.'</h2>

                <img src="'.$row_photo["Url"].'" alt="'.$row_photo["Alt"].'"/>
                
                <div id="overallrank">
                </div>

                <div id="rank">';
                
require_once dirname(__FILE__). '/con_hostel_star.php';
echo '</div>


                <div id="maininfo" >
                <table name="maininfo">
                    <tr>
                        <td>Address:</td>
                        <td>'.$address.'</td>
                    </tr>
                     <tr bgcolor="#D8DFE6">
                        <td>Lowest price:</td>
                        <td>'.$pricemin.'</td>
                    </tr>
                     <tr>
                        <td>Highest price:</td>
                        <td>'.$pricemax.'</td>
                    </tr>
                    <tr bgcolor="#D8DFE6">
                        <td>Number of rooms:</td>
                        <td>'.$rooms.'</td>
                    </tr>
                    <tr>
                        <td>Number of beds:</td>
                        <td>'.$beds.'</td>
                    </tr>

                </table>
                </div>

                <div id="book_feedback">
                <table width="370">
                <tr>
                    <td width="140"><div id="book"><a href="book.php?hid='.$hid.'"><h2>Book Now!</h2></a></div></td>
                    <td width="230"><div id="feed"><a href="feedback_review.php?hid='.$hid.'"><h2>Feedback reviews!</h2></a></div></td>
                </tr>
                </table>
                </div>


                </div>

                <div id="description">
		<h2>Description</h2></br>'.$desc.'
                </div>

                <div id="infodetails" >
                    <div id="infodetails1">
                     <table name="infodetails1">
                     <tr bgcolor="#D8DFE6">
                        <td>Number of toilets:</td>
                        <td>'.$toilets.'</td>
                    </tr>
                    <tr>
                        <td>Included in price:</td>
                        <td>'.$included.'</td>
                    </tr>
                    <tr bgcolor="#D8DFE6">
                        <td>Reception:</td>
                        <td>'.$reception.'</td>
                    </tr>
                    <tr>
                        <td>Web access:</td>
                        <td>'.$web.'</td>
                    </tr>
                    </table>
                    </div>
                    <div id="infodetails2">
                    <table name="infodetails2">
                    <tr bgcolor="#D8DFE6">
                        <td>Food/drink:</td>
                        <td>'.$fooddrink.'</td>
                    </tr>
                    <tr>
                        <td>In room:</td>
                        <td>'.$inroom.'</td>
                    </tr>
                    <tr bgcolor="#D8DFE6">
                        <td>Things to do:</td>
                        <td>'.$todo.'</td>
                    </tr>
                    <tr>
                        <td>General:</td>
                        <td>'.$general.'</td>
                    </tr>

                    </table>
                    
                    </div>
                   
                </div>



               

		<div class="gallery">
                <h3>Photo gallery</h3>';


                while ($row_photo_notindex = mysql_fetch_array($result_photo_notindex)) {
                echo '<a href="'.$row_photo_notindex["Url"].'" rel="lightbox[a]">
		<img src="'.$row_photo_notindex["Url"].'" alt="'.$row_photo_notindex["Alt"].'" rel="lightbox[a]"/></a>&nbsp;
		';
                }
                
  echo '</div></div>';

mysql_close($con);
?>
